﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Classes
{
    class Program
    {
        static void Main(string[] args)
        {
            Inteticszp firstEmploye = new Inteticszp();
            firstEmploye.firstName = "Иван";
            firstEmploye.lastName = "Иванов";
            firstEmploye.salary = 300;
            Inteticszp secondEmploye = new Inteticszp();
            secondEmploye.firstName = "Петр";
            secondEmploye.lastName = "Петров";
            firstEmploye.salary = 400;
            Inteticszp thirdEmploye = new Inteticszp();
            thirdEmploye.firstName = "Василий";
            thirdEmploye.lastName = "Васильев";
            thirdEmploye.salary = 350;
            Inteticszp fourEmploye = new Inteticszp();
            fourEmploye.firstName = "Николай";
            fourEmploye.lastName = "Ковалёв";
            fourEmploye.salary = 450;
            Inteticszp fifthEmploye = new Inteticszp();
            fifthEmploye.firstName = "Аркадий";
            fifthEmploye.lastName = "Пяточкин";
            fifthEmploye.salary = 500;

            Inteticszp[] employesArray = new Inteticszp [5];
            employesArray[0] = firstEmploye;
            employesArray[1] = secondEmploye;
            employesArray[2] = thirdEmploye;
            employesArray[3] = fourEmploye;
            employesArray[4] = fifthEmploye;

            int sum = 0;
            foreach (var Inteticszp in employesArray)
            {
                Inteticszp.Employes();
                sum += Inteticszp.salary;
            }
            Console.WriteLine("Суммарная зарплата = {0}", sum);
        }
    }
}
